@(corpid: String,company:String)(implicit request: RequestHeader,messagesProvider: MessagesProvider,session:Session)

@import helper._
@import views.html.dingtalk.ionicmain
@ionicmain("message(0)",scripts=js, modals=modals) {

<script>
var dingCorpId = "@corpid";
var company = "@company";
</script>
<ion-header>
    <ion-toolbar>
        <ion-buttons slot="start">
            <ion-menu-button></ion-menu-button>
        </ion-buttons>
        <ion-title>用户登陆</ion-title>
    </ion-toolbar>
</ion-header>
<ion-content class="ion-padding">

    <center>
        @request.flash.get("success").map { key =>
        @messagesProvider.messages(key)
        }
        <div class="" style="width:300px;height: 200px;">
            <form class="layui-form" action="">
                <div class="layui-form-item">
                    <input hidden type="text" name="accid" value="0">
                    <label class="layui-form-label">用户</label>
                    <div class="layui-input-inline">
                        <input type="text" name="p1" required  lay-verify="required" placeholder="请输入用户" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">密码</label>
                    <div class="layui-input-inline">
                        <input type="password" name="p2" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
                        @CSRF.formField
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">验证码</label>
                    <div class="layui-input-inline">
                        <input type="text" name="loginCpacha" required lay-verify="required" placeholder="请输入验证码" autocomplete="off" class="layui-input">
                        <img id="cpacha-img" title="点击切换验证码" style="cursor:pointer;" src="/users/cpacha?vl=4&w=150&h=40&type=loginCpacha" width="110px" height="30px" >
                    </div>

                    <div class="layui-form-mid layui-word-aux" id="login-info">辅助文字</div>
                </div>

                <div class="buttons">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </form>
        </div>
    </center>

</ion-content>
<ion-content  class="ion-padding">

</ion-content>

}

@js = {
<script src='@routes.Assets.versioned("js/layui_login.js")' type="text/javascript"></script>
}
@modals = {
if ( document.getElementsByTagName("body")[0].accessKey != "nologin"){
    @if(session.get("surl").nonEmpty){
    var surl = '@session.get("surl")';
    console.log("surl="+surl);
    window.top.location.href = surl;
    }else{
    window.top.location.href = '@routes.UsersController.index()';
    }
};
}
